﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infraestructure.CrossCutting.Caching;
using Enterprise = Microsoft.Practices.EnterpriseLibrary.Caching;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Caching;

namespace Infraestructure.CrossCutting.NetFramework.Caching
{
    public sealed class CacheMemoryManager
        : Infraestructure.CrossCutting.Caching.ICacheManager
    {

        public void StoreData(string key, object value)
        {
            Enterprise.ICacheManager defaultCache = EnterpriseLibraryContainer.Current.GetInstance<Enterprise.ICacheManager>();
            defaultCache.Add(key, value);
        }

        public object GetData(string key)
        {
            Enterprise.ICacheManager defaultCache = EnterpriseLibraryContainer.Current.GetInstance<Enterprise.ICacheManager>();
            return defaultCache.GetData(key);
        }
    }
}
